<?
    $cnt = count($visited);
    if ($cnt > 4)
        $cnt = 4;
?>
<ul class="recentlyBooked">
    <?
        for ($i = 0; $i < $cnt; $i++):
            $obj_name = URLify::filter($visited[$i]->object_name);
            $href = lang_url('accommodation/' . $obj_name . '-' . $visited[$i]->object_ID . '?preview=1&room_id=' . $visited[$i]->rooms[0]->room_ID).lcu();
            ?>
            <li>
                <? $thumbnail = HOST_URL_HOTELS . $visited[$i]->photo_path . '/thumb_70x70/' . $visited[$i]->photo_name; ?>
                <? $thumbnail_preview = HOST_URL_HOTELS . $visited[$i]->photo_path . '/thumb_300x178/' . $visited[$i]->photo_name; ?>
                <a href="<?= $href ?>" class="clearfix recentlyLatest HoverImg" data-id="<?= $thumbnail_preview ?>" title="<?= str_replace("- Montenegro", "", $visited[$i]->object_name) ?>">
                    <div class="row">
                        <div class="span1"><img src="<?= $thumbnail ?>" alt="<?= $visited[$i]->photo_title ?>" class="img-rounded"  /></div>
                        <div class="span3">
                            <h3 class="ellipsis"><?= str_replace("- Montenegro", "", $visited[$i]->object_name) ?></h3>
                            <p class="ellipsis"><?= $visited[$i]->destination_name ?></p>
                            <div class="latest"><?= lang('most_viewed_views') . ': ' . $visited[$i]->object_no_visits; ?></div>
                        </div>
                    </div>
                </a>

            </li>
        <? endfor; ?> 
</ul>